<?php
namespace Modules\Admin\Model\Dao\Db\Menu;

use Modules\Admin\Model\Dao\Db\Db as AdminModelDaoDb;

class Button extends AdminModelDaoDb {
    private $table;

    public function __construct() {
        $this->table = self::table('button');
    }

    public function saveButtonInfo($data, $id = '') {
        if ($id) {
            return self::db()->update($this->table, $data, ['mc_id' => $id]);
        } else {
            return self::db()->insert($this->table, $data, true, true);
        }
    }

    public function queryButtonList() {
        return self::db()->query($this->table, array(), array());
    }
}
